package com.shiyo.spring.basic_di.c_value_spel;

import com.shiyo.spring.basic_di.c_value_spel.bean.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class ValueAnnoApplication {
    public static void main(String[] args) {
        //扫描该路径下的bean
        ApplicationContext context = new AnnotationConfigApplicationContext("com.shiyo.spring.basic_di.c_value_spel.bean");
        //Value注解
        Black black = context.getBean(Black.class);
        System.out.println(black);

        Red red = context.getBean(Red.class);
        System.out.println(red);

        Blue blue = context.getBean(Blue.class);
        System.out.println(blue);

//        for (String beanDefinitionName : context.getBeanDefinitionNames()) {
//            System.out.println(beanDefinitionName);
//        }
        Green green = context.getBean(Green.class);
        System.out.println(green);

        White white = context.getBean(White.class);
        System.out.println(white);
    }
}
